home *** CD-ROM | disk | FTP | other *** search
/ Programming Languages Suite / ProgramD2.iso / Borland / Borland C++ V5.02 / WINSYS.PAK / PROFILE.H < prev    next >
C/C++ Source or Header  |  1997-05-06  |  1KB  |  51 lines

  1. //----------------------------------------------------------------------------
  2. // Borland WinSys Library
  3. // Copyright (c) 1994, 1996 by Borland International, All Rights Reserved
  4. //
  5. //$Revision:   5.9  $
  6. //
  7. // Definition of TProfile class
  8. //----------------------------------------------------------------------------
  9. #if !defined(WINSYS_PROFILE_H)
  10. #define WINSYS_PROFILE_H
  11.  
  12. #if !defined(WINSYS_DEFS_H)
  13. # include <winsys/defs.h>
  14. #endif
  15.  
  16. #if defined(BI_NAMESPACE)
  17. namespace ClassLib {
  18. #endif
  19.  
  20. //
  21. // class TProfile
  22. // ~~~~~ ~~~~~~~~
  23. class _WSYSCLASS TProfile  {
  24.   public:
  25.     // Use system global profile for filename==0
  26.     //
  27.     TProfile(const _TCHAR far* section, const _TCHAR far* filename = 0);
  28.    ~TProfile();
  29.  
  30.     int GetInt(const _TCHAR far* key, int defaultInt = 0);
  31.  
  32.     // Returns all section values if key==0
  33.     //
  34.     bool GetString(const _TCHAR far* key, _TCHAR far* buff,
  35.                    unsigned buffSize, const _TCHAR far* defaultString = "");
  36.  
  37.     bool WriteInt(const _TCHAR far* key, int value);
  38.     bool WriteString(const _TCHAR far* key, const _TCHAR far* str);
  39.     void Flush();
  40.  
  41.   protected:
  42.     _TCHAR far* Section;     // Name of the section to use
  43.     _TCHAR far* FileName;    // File name of the .INI file
  44. };
  45.  
  46. #if defined(BI_NAMESPACE)
  47. }     // namespace ClassLib 
  48. #endif
  49.  
  50. #endif  // WINSYS_PROFILE_H
  51.